<div class="row">

    <div class="col-md-12">       

        <div class="block">
            <div class="block-title">
                <h2><strong>Formulario de Usuario</strong> </h2>
            </div>
           
                <?php echo $this->Form->create('User', array('class'=>'form-horizontal form-bordered'));?>	    
                <fieldset>
                    <!--<legend><i class="fa fa-angle-right"></i> Vital Info</legend>-->
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="data[User][nombre]">Nombres <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->hidden('id');?>
                                <?php echo $this->Form->text('nombres',array('class' => 'form-control','placeholder' => 'Ingrese el nombre o nombres del usuario'));?>
                                <span class="input-group-addon"><i class="gi gi-user"></i></span>
                            </div>
                        </div>

                        <label class="col-md-2 control-label" for="data[User][ap_paterno]">Apellido Paterno <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->text('ap_paterno',array('class' => 'form-control','placeholder' => 'Ingrese el apellido paterno'));?>
                                <span class="input-group-addon"><i class="hi hi-user"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label" for="data[User][ap_materno]">Apellido Materno <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->text('ap_materno',array('class' => 'form-control','placeholder' => 'Ingreseel apellido paterno'));?>
                                <span class="input-group-addon"><i class="gi gi-user"></i></span>
                            </div>
                        </div>

                        <label class="col-md-2 control-label" for="data[User][ci]">Carnet de Identidad <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->text('ci',array('class' => 'form-control','placeholder' => 'Ingrese el C.I.','type'=>'number'));?>
                                <span class="input-group-addon"><i class="gi gi-credit_card"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label" for="data[User][telefono]">Telefono <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->text('telefono',array('class' => 'form-control','placeholder' => 'Ingrese el telefono','type'=>'number'));?>
                                <span class="input-group-addon"><i class="gi gi-phone_alt"></i></span>
                            </div>
                        </div>
                        <label class="col-md-2 control-label" for="val_skill">Perfil <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <?php 
                            if($this->Session->read('Auth.User.role') != 'Administrador')
                            {
                                $hperfil = 'disabled';
                            }
                            else{
                                $hperfil = '';
                            }
                            ?>
                            <?php 
                            $roles = array('Administrador' => 'Administrador','Secretaria' => 'Secretaria');
                            ?>
                            <?php echo $this->Form->select('role',$roles,array('class' => 'form-control',$hperfil))?>
                            
                        </div>
                        
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label" for="data[User][username]">Usuario <span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php echo $this->Form->text('username',array('class' => 'form-control','placeholder' => 'Ingrese el Usuario'));?>
                                <span class="input-group-addon"><i class="gi gi-asterisk"></i></span>
                            </div>
                        </div>

                        <label class="col-md-2 control-label" for="data[User][password]">Password<span class="text-danger">*</span></label>
                        <div class="col-md-3">
                            <div class="input-group">
                                <?php 
                                if(empty($this->request->data['User']['id']))
                                {
                                    $requerido = 'required';
                                }
                                else{
                                    $requerido = '';
                                }
                                ?>
                                <?php echo $this->Form->password('password_n',array('class' => 'form-control','placeholde' => 'Ingrese el password',$requerido));?>
                                <span class="input-group-addon"><i class="gi gi-asterisk"></i></span>
                            </div>
                        </div>
                    </div> 

                </fieldset>

                <div class="form-group form-actions">
                    <div class="col-md-8 col-md-offset-4">
                        <button type="submit" class="btn btn-sm btn-primary"><i class="fa fa-arrow-right"></i> Registrar</button>
                    </div>
                </div>
            <?php echo $this->Form->end();?>

        </div>
    </div>    
</div>